
  ___  ____  ____  ____  ____ ®
 /__    /   ____/   /   ____/      18.0
___/   /   /___/   /   /___/       MP—Parallel Edition

 Statistics and Data Science       Copyright 1985-2023 StataCorp LLC
                                   StataCorp
                                   4905 Lakeway Drive
                                   College Station, Texas 77845 USA
                                   800-STATA-PC        https://www.stata.com
                                   979-696-4600        stata@stata.com

Stata license: 22-user 8-core network, expiring 30 Jun 2025
Serial number: 501809309427
  Licensed to: The University of Chicago Booth School of Business
               Mercury Computing Cluster

Notes:
      1. Stata is running in batch mode.
      2. Unicode is supported; see help unicode_advice.
      3. More than 2 billion observations are allowed; see help obs_advice.
      4. Maximum number of variables is set to 5,000 but can be increased;
          see help set_maxvar.

. do "/project/fagoolsb/git/service_industries/replication_package/builds/3_gws
> _build/3_3_gws_build.do" 

. * Author: Joe Tatarka
. * Name: 3_3_gws_build.do
. * Date: April 15, 2025
. * Purpose: Create a build from the GWS data 
. * Combine the GWS Panel and GWS App Delivery to create a final dataset 
. 
. * Set Global File Paths
. global data_root = "/project/fagoolsb/service_industries/replication_package/
> datasets/built"

. global intermediate_root = "/project/fagoolsb/service_industries/replication_
> package/datasets/intermediate/3_gws_build"

. 
. ******************************
. **** Step 1: Bring in the panel 
. use "${intermediate_root}/3_2_gws_app_usage.dta", clear

. 
. ***********************************************************************
. ******* Step 2: Merge App Usage with how many days the panelist days there ar
> e 
. sort year_month_gs

. merge 1:1 year_month_gs using "${intermediate_root}/3_1_gws_panel.dta", nogen
>  keep(1 3)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                                65  
    -----------------------------------------

. 
. **********************************************************
. **** Step 3: Create App Usage per day for delivery and driver apps
. ** Duration per number of days people are in the panel in that given month
. gen delivery_use_per_day = app_use_all_delivery/panel_days

. gen driver_use_per_day = app_use_all_driver/panel_days

. 
. *** Index to 2019 Average values 
. foreach var of varlist delivery_use_per_day driver_use_per_day {
  2.         egen `var'_2019 = mean(`var') if year_month_gs <= monthly("dec2019
> ", "MY") & year_month_gs >= monthly("jan2019", "MY")
  3.         egen m`var'_2019 = max(`var'_2019)
  4.         gen `var'_idx2019 = 100*(`var'/m`var'_2019)
  5.         drop `var'_2019 m`var'_2019
  6. }
(53 missing values generated)
(53 missing values generated)

. 
. label var delivery_use_per_day "Delivery App Usage (Aggregate Minutes per Day
> )"

. label var delivery_use_per_day "Driver App Usage (Aggregate Minutes per Day)"

. label var delivery_use_per_day_idx2019 "Delivery App Usage (2019 Avg = 100)"

. label var delivery_use_per_day_idx2019 "Driver App Usage (2019 Avg = 100)"

. 
. **** Keep from Jan 2019 - Dec 2023
. keep if year_month_gs >= monthly("jan2019", "MY") & year_month_gs <= monthly(
> "dec2023", "MY")
(5 observations deleted)

. 
. *****************************************************************************
> ***
. **** Save Dataset
. *****************************************************************************
> ***
. save "${data_root}/gws_build.dta", replace
file
    /project/fagoolsb/service_industries/replication_package/datasets/built/g
    > ws_build.dta saved

. 
. 
. 
end of do-file


. 